<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>
    
    var str = "中文";

    var code1 = str.charCodeAt(0);
    var code2 = str.charCodeAt(1);

    console.log(code1);
    console.log(code2);

    console.log( String.fromCharCode(20013) );
    console.log( String.fromCharCode("0x4e2d") );
    console.log( String.fromCharCode("\u4e2d") );
    console.log( "\u4e2d" );
    console.log( String.fromCharCode(25991) );

</script>
</html>